<div id="steps" class="form complex">
    <?php
//echo form_open('peserta/peserta/insert_peserta');
    ?>

    <script>
        function konfirm()
        {
            confirm("Selamat, Registarsi Telah Berhasil Dilakukan.");
        }
    </script>

    <?
    //Setting Value Jika Prosedur yang dilakukan adalah prosedur input biasa.
    $value = array(
        'id_alumni' => "",
        'nama_alumni' => "",
        'nama_panggilan' => "",
        'jenis_kelamin' => "",
        'alamat' => "",
        'kode_pos' => "",
        'id_kota' => "",
        'tempat_lahir' => "",
        'tanggal' => "",
        'bulan' => "",
        'tahun' => "",
        'no_hp' => "",
        'email' => "",
        'twitter' => "",
        'pekerjaan' => "",
        'nama_usaha' => "",
        'jenis_usaha' => "",
        'omset' => "",
        'id_batch' => $id_batch,
        'back_link' => $back_link,
        'act_form' => "alumni/alumni/insert_alumni/"
    );

    //Setting Value pada form Jika melakukan prosedur Edit terhadap data tertentu.
    if ($status == "edit") {
        $value['id_alumni'] = $id_alumni;
        $value['nama_alumni'] = $nama_alumni;
        $value['nama_panggilan'] = $nama_panggilan;
        $value['jenis_kelamin'] = $jenis_kelamin;
        $value['alamat'] = $alamat;
        $value['kode_pos'] = $kode_pos;
        $value['id_kota'] = $id_kota;
        $value['tempat_lahir'] = $tempat_lahir;
        $value['tanggal'] = $tanggal;
        $value['bulan'] = $bulan;
        $value['tahun'] = $tahun;
        $value['no_hp'] = $no_hp;
        $value['email'] = $email;
        $value['twitter'] = $twitter;
        $value['pekerjaan'] = $pekerjaan;
        $value['nama_usaha'] = $nama_usaha;
        $value['jenis_usaha'] = $jenis_usaha;
        $value['omset'] = $omset;
        $value['back_link'] = $back_link;
        $value['id_batch'] = $id_batch;

        $value['act_form'] = "alumni/alumni/update_alumni/" . $value['id_alumni'];
    }//end if
    ?>
    <?= form_open($value["act_form"]); ?>

    <form>
        <fieldset class="step">

            <p>
                <label>Nama Lengkap*</label>
                <input id="" name="nama_alumni" type="text" value="<?= $value['nama_alumni'] ?>" tabindex="1" />
            </p>
            <?php echo form_error('nama_alumni'); ?>

            <p>
                <label>Nama Panggilan*</label>
                <input  id="nama" name="nama_panggilan" type="text" value="<?= $value['nama_panggilan'] ?>" tabindex="1" />
            </p>
            <?php echo form_error('nama_panggilan'); ?>
            
            <p>
                <label>Jenis Kelamin*</label>
                <?
                //list jenis kelamin
                $options['0'] = "-- Pilih Jenis Kelamin --";
                $options['L'] = "Laki-laki";
                $options['P'] = "Perempuan";
                echo form_dropdown('jenis_kelamin', $options, $value["jenis_kelamin"], 'class="field select"');
                ?>
            </p>
            <?php echo form_error('jenis_kelamin'); ?>

            <p>
                <label>Alamat Rumah*</label>
                <textarea  id="element_2" name="alamat" ><?= $value['alamat'] ?></textarea> 
            </p>
            <?php echo form_error('alamat'); ?>
            
            <p>
                <label>Kode Pos*</label>
                <input  id="nama" name="kode_pos" type="text" value="<?= $value['kode_pos'] ?>" tabindex="1" /> 
            </p>
            <?php echo form_error('kode_pos'); ?>
            
            <p>
                <label>Kota*</label>
                <?
                unset($options);
                $options['0'] = "-- Pilih Kota --";
                foreach ($kota->result() as $row) {
                    $options[$row->ID_KOTA] = $row->NAMA_KOTA;
                }
                echo form_dropdown('id_kota', $options, $value["id_kota"], 'class="field select"');
                ?>	
            </p>
            <?php echo form_error('id_kota'); ?>
            

            <p>
                <label>Tempat Lahir*</label>
                <input  id="nama" name="tempat_lahir" type="text" value="<?= $value['tempat_lahir'] ?>" tabindex="1" />
            </p>
            <?php echo form_error('tempat_lahir'); ?>
            
            <p>	
                <label>Tanggal Lahir*</label>
                <input  READONLY style="width: 30px;margin-right:5px;" id="element_4_2" name="tgl" size="2" maxlength="2" value="<?= $value['tanggal'] ?>" type="text">
                <input  READONLY style="width:30px;margin-right:5px;" id="element_4_1" name="bln" size="2" maxlength="2" value="<?= $value['bulan'] ?>" type="text">
                <input  READONLY style="width: 80px;" id="element_4_3" name="thn" size="4" maxlength="4" value="<?= $value['tahun'] ?>" type="text">

                <img id="cal_img_4" src="<?= base_url(); ?>images/form/calendar.gif" alt="Pick a date.">	
                <?
                if ($status != 'preview') {
                    echo'
					<script type="text/javascript">
						Calendar.setup({
						inputField	 : "element_4_3",
						baseField    : "element_4",
						displayArea  : "calendar_4",
						button		 : "cal_img_4",
						ifFormat	 : "%B %e, %Y",
						onSelect	 : selectDate
						});					
					</script>
					';
                }
                ?>
            </p>
            <?php echo form_error('thn'); ?>

            <p>
                <label>No Telepon/Handphone*</label>
                <input  id="nama" name="no_hp" type="text" value="<?= $value['no_hp'] ?>" tabindex="1" />
            </p>
            <?php echo form_error('no_hp'); ?>
            
            <p>
                <label>Alamat Email*</label>
                <input  id="nama" name="email" type="text" value="<?= $value['email'] ?>" tabindex="1" />
            </p>
            <?php echo form_error('email'); ?>
            
            <p>
                <label>Twitter Account (ID Twitter Anda. ex : @ECampIndonesia. Kosongkan jika belum punya.</label>
                <input  id="nama" name="twitter" type="text" value="<?= $value['twitter'] ?>" tabindex="1" />
            </p>

            <p>
                <label>Pekerjaan*</label>
                <?
                //list pekerjaan
                unset($options);
                $options['0'] = "-- Pilih Pekerjaan --";
                $options['Pelajar/Mahasiswa'] = "Pelajar/Mahasiswa";
                $options['Karyawan Swasta'] = "Karyawan Swasta";
                $options['Wiraswasta'] = "Wiraswasta";
                $options['Pegawai Negeri/BUMN'] = "Pegawai Negeri/BUMN";
                $options['Yang Lain'] = "Yang Lain";
                echo form_dropdown('pekerjaan', $options, $value["pekerjaan"], 'class="field select"');
                ?>
            </p>
            <?php echo form_error('pekerjaan'); ?>
            
            <p>
                <label>Nama Usaha</label>
                <input  id="nama" name="nama_usaha" type="text" value="<?= $value['nama_usaha'] ?>" tabindex="1" />
            </p>
            <p>
                <label>Jenis Usaha</label>
                <input  id="nama" name="jenis_usaha" type="text" value="<?= $value['jenis_usaha'] ?>" tabindex="1" />
            </p>
            <p>
                <label>Omset Sekarang</label>
                <input  id="nama" name="omset" type="text" value="<?= $value['omset'] ?>" tabindex="1" />
            </p>

            <p>
                <label>Angkatan/Batch*</label>
                <?
                unset($options);
                $options['0'] = "-- Pilih Batch --";
                foreach ($batch->result() as $row) {
                    $options[$row->ID_BATCH] = $row->NAMA_BATCH;
                }
                echo form_dropdown('batch', $options, $value["id_batch"], 'class="field select"');
                ?>	

            </p>
            <?php echo form_error('batch'); ?>

            
            <p class="submit">
                <button id="registerButton" type="submit">Simpan</button>&nbsp;
                <button id="registerButton" type="reset">Reset</button>&nbsp;
                <button id="registerButton" TYPE="BUTTON" VALUE="Back" ONCLICK="window.location.href='<?= $value['back_link'] ?>'">Kembali</button>


        </fieldset>
    </form> 
    <?php
    echo form_close();
    ?>
</div>